<div class="layui-card">
    <div class="layui-card-body">
        <table class="layui-table" id="task-comment-table" lay-filter="task-comment-table"></table>
    </div>
</div>

<script>
    layui.use(['form', 'table', 'util', 'config', 'admin'], function () {
        var form = layui.form;
        var table = layui.table;
        var config = layui.config;
        var layer = layui.layer;
        var util = layui.util;
        var admin = layui.admin;

        let task = admin.getTempData('t_task');
        // 渲染表格
        table.render({
            elem: '#task-comment-table',
            // url: config.base_server + 'user_query.json',
            url: config.base_server + 'api-task/task/findTaskComment',
            method: 'GET',
            where: {
                access_token: config.getToken().access_token,
                taskid: task.taskid
            },
            page: true,
            cols: [[
                {type: 'numbers'},
                {field: 'userId', sort: true, title: '评论用户', align: 'center'},
                {field: 'content', sort: true, title: '评论内容', align: 'center'},
                {field: 'clikes', sort: true, title: '点赞量', align: 'center'},
                {field: 'creply', sort: true, title: '回复量', align: 'center'},
                {field: 'status', sort: true, title: '状态', align: 'center'},
            ]]
        })
    });
</script>